import axios from 'axios'

const baseUrl = ''
const apiUrl = 'http://rap.taobao.org/mockjsdata/30384/'
class Services {
  getTypeProduct(){
    return require('~/static/api/typeProduct.json')
  }
  getnewProduct(){
    const data = require('~/static/api/newProduct.json')
    return data
  }


  getWechatSignature(url) {
    return axios.get(`${baseUrl}/wechat-signature?url=${url}`)
  }
  getUserByOAuth(url) {
    return axios.get(`${baseUrl}/wechat-oauth?url=${url}`)
  }
  fetchHouses() {
    return axios.get(`${apiUrl}wiki/houses`)
  }
  fetchHouse(id) {
    return axios.get(`${apiUrl}wiki/houses/${id}`)
  }
  fetchCharacters() {
    return axios.get(`${apiUrl}wiki/characters`)
  }
  fetchCities() {
    return axios.get(`${apiUrl}wiki/cities`)
  }
  fetchPanHome() {
    return axios.get(`${apiUrl}home`)
  }
  fetchProducts() {
    return axios.get(`${apiUrl}wiki/products`)
  }
  fetchProduct(id) {
    return axios.get(`${apiUrl}wiki/products/${id}`)
  }
  fetchPayments() {
    return axios.get(`${apiUrl}api/user`)
  }
}

export default new Services()